package com.financing.platform.service.impl;


import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IXcxSearchnoRecordDao;
import com.financing.platform.dto.XcxSearchnoRecordDTO;
import com.financing.platform.service.IXcxSearchnoRecordService;
/**
 * xcx_searchno_record  
 * 小程序产品关键字搜索未果结果记录 业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("xcxSearchnoRecordService")
public class XcxSearchnoRecordServiceImpl implements IXcxSearchnoRecordService{

	@Autowired
	private IXcxSearchnoRecordDao xcxSearchnoRecordDao;

	@Override
	public int insert(XcxSearchnoRecordDTO xcxSearchnoRecord) throws SQLException {
//		DTOdateSetUtil.setCreateInfo(xcxSearchnoRecord);
//		DTOdateSetUtil.setUpdateInfo(xcxSearchnoRecord);
//		xcxSearchnoRecord.setDeleteTag(CommonStatus.DELETE_TAG_NORMAL);
		return xcxSearchnoRecordDao.insert(xcxSearchnoRecord);
	}

	@Override
	public void update(XcxSearchnoRecordDTO xcxSearchnoRecord) throws SQLException {
		xcxSearchnoRecord.setUpdateDate(new Date());
		xcxSearchnoRecordDao.update(xcxSearchnoRecord);
	}

	@Override
	public void updateForce(XcxSearchnoRecordDTO xcxSearchnoRecord) throws SQLException {
//		DTOdateSetUtil.setUpdateInfo(xcxSearchnoRecord);
		xcxSearchnoRecordDao.updateForce(xcxSearchnoRecord);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		xcxSearchnoRecordDao.delete(id);
	}
	
	@Override
	public List<XcxSearchnoRecordDTO> queryList(XcxSearchnoRecordDTO xcxSearchnoRecord) throws SQLException {
		return xcxSearchnoRecordDao.queryList(xcxSearchnoRecord);
	}

	@Override
	public int queryListCount(XcxSearchnoRecordDTO xcxSearchnoRecord) throws SQLException {
		return xcxSearchnoRecordDao.queryListCount(xcxSearchnoRecord);
	}

	@Override
	public XcxSearchnoRecordDTO loadById(Integer id) throws SQLException {
		return xcxSearchnoRecordDao.loadById(id);
	}
 	@Override
	public XcxSearchnoRecordDTO queryListGetFirst(XcxSearchnoRecordDTO xcxSearchnoRecord)
			throws SQLException {
		 List<XcxSearchnoRecordDTO> queryList = queryList(xcxSearchnoRecord);
		 if(queryList==null||queryList.size()==0){
			 return new XcxSearchnoRecordDTO();
		 }
		 return queryList.get(0);
	}

	@Override
	public List<XcxSearchnoRecordDTO> queryAllList(
			XcxSearchnoRecordDTO xcxSearchnoRecord) throws SQLException {
		// TODO Auto-generated method stub
		return xcxSearchnoRecordDao.queryAllList(xcxSearchnoRecord);
	}

	@Override
	public void updateByKeyword(XcxSearchnoRecordDTO xcxSearchnoRecord)
			throws SQLException {
		xcxSearchnoRecordDao.updateByKeyword(xcxSearchnoRecord);
	}
}
